<template>
	<div class="task-reporting">
		<zk-searcher v-model="query" :options="searchColumns" />
		<w-block class="body" title="提醒信息列表" style="margin-top: 10px">
			<zk-table
				:columns="tableColumns"
				:service="service"
				:query="query"
				:actions="actions"
				@doOtherAction="doActions"
			>
			</zk-table>
		</w-block>
	</div>
</template>
<script>
import { TYPE_ENUM }                         from '@/common/zk-constants'
import { taskSupervisorReminder as service } from '@/services'
import SearchTableCRUDMixin                  from '@/mixins/search-table-crud-mixin'

const columns = [
	{ 'label': '项目名称', 'key': 'project_name', table: true, search: true, form: true, required: true },
	{ 'label': '工作名称', 'key': 'work_name', table: true, form: true, required: true },
	{ 'label': '任务名称', 'key': 'task_name', table: true, form: true, required: true },
	{
		'label' : '完成情况',
		'key'   : 'finish_state',
		table   : true,
		search  : true,
		type    : TYPE_ENUM.SELECT,
		storeKey: 'finishState',
		form    : true
	},
	{ 'label': '应完成日期', 'key': 'should_done_time', table: true, type: TYPE_ENUM.DATE_TIME, form: true },
	{ 'label': '提醒日期', 'key': 'tip_time', table: true, type: TYPE_ENUM.DATE_TIME, form: true },
	{
		'label' : '责任部门',
		'key'   : 'duty_dept',
		table   : true,
		search  : true,
		type    : TYPE_ENUM.SELECT,
		storeKey: 'orgList',
	},
]

const actions = [
	{ classname: 'primary', text: '办理', type: 'handle' }
]
export default {
	mixins  : [SearchTableCRUDMixin],
	data() {
		return {
			columns,
			service,
			actions,
			query: {
				finish_state: '01'
			}
		}
	},
	computed: {
		modalTitle() {
			return this.isAddModal ? '添加' : '编辑'
		},
	},
	methods : {
		async doActions({ row = {}, type }) {
			console.log(row);
			type === 'handle' && this.$router.push({
				path : `/tree-task/${ row.project_id }`,
				query: {
					projectName: row.project_name,
					taskPzId   : row.task_id
				}
			})
		},
	},
}
</script>
<style scoped lang="scss">
</style>

